package com.organization

class Department {

	String	name
	Date	dateCreated
	String	description
	
	static hasMany = [projects: Project]

    static constraints = {
		name(blank:false, size:3..20,unique: true)
		description(nullable:true, maxSize:20)
        dateCreated(nullable:true)
    }

    static mapping = {
        projects cascade: 'all-delete-orphan'
    }

	String toString(){
		return name;
	}
}
